package com.wei.service_oss.util;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.stereotype.Component;

/**
 * @author wjx
 * @ClassName ConstantPropertiesUtil
 * @description: TODO
 * @date 2022-11-28 18:35
 * @version: 1.0
 */
@Component
public class ConstantPropertiesUtil implements InitializingBean {

    @Value("${alibaba.cloud.access-key}")
    private String keyId;

    @Value("${alibaba.cloud.secret-key}")
    private String keySecret;

    @Value("${alibaba.cloud.oss.endpoint}")
    private String endpoint;

    @Value("${alibaba.cloud.oss.bucket}")
    private String bucket;

    public static String KEY_ID;
    public static String KEY_SECRET;
    public static String ENDPOINT;
    public static String BUCKET;

    @Override
    public void afterPropertiesSet() throws Exception {
        KEY_ID = keyId;
        KEY_SECRET = keySecret;
        ENDPOINT = endpoint;
        BUCKET = bucket;
    }
}
